/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
 * Projects
 * Copyright (C) Arnaud Duval 2010 <arnaud.duval@gmail.com>
 * 
 * Projects is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Projects is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 */


#include <Interval.hpp>


int main (int argc, char *argv[])
{
    ///@brief Test default constructor
    Interval defaultInterval;
    
    ///@brief Test constructor with arguments
    DateTime begin(1982,9,20,7,15,0);
    DateTime end(1982,9,20,7,30,15);
    Duration dur;
    dur.Difference(end, begin);
    std::string name = "My test interval";
    Interval testInterval(begin, dur, name);
    
    if(testInterval.GetStartDateTime() != begin)
        return 1;
    if(testInterval.GetEndDateTime() != end)
        return 1;
    if(testInterval.GetName() != "My test interval")
        return 1;
    
    ///@brief test operator =
    defaultInterval = testInterval;
    if(defaultInterval.GetStartDateTime() != begin)
        return 1;
    if(defaultInterval.GetEndDateTime() != end)
        return 1;
    if(defaultInterval.GetName() != "My test interval")
        return 1;
    
    ///@brief test GetDuration function
    if(testInterval.GetDuration().ValueInSeconds() != 915.)
        return 1;
    

        
    
    return 0;
}
